#include "parameteritem.h"

ParameterItem::ParameterItem(QObject *parent) : QObject(parent) { clear(); }

void ParameterItem::clear()
{
    m_id = 0;
    m_Name = "";
    m_Process1 = "";
    m_Process2 = "";
    m_F_UpperKnife01Assist = "";
    m_F_UpperKnife02Assist = "";
    m_B_UpperKnife01Assist = "";
    m_B_UpperKnife02Assist = "";
    m_F_UpperKnife01 = "";
    m_F_UpperKnife02 = "";
    m_B_UpperKnife01 = "";
    m_B_UpperKnife02 = "";
    m_F_LowerKnife01 = "";
    m_F_LowerKnife02 = "";
    m_B_LowerKnife01 = "";
    m_B_LowerKnife02 = "";
    m_Roller = "";
}

void ParameterItem::copyItem(ParameterItem *item)
{
    if (!item) return;
    m_id = item->id();
    m_Name = item->Name();
    m_Process1 = item->Process1();
    m_Process2 = item->Process2();
    m_F_UpperKnife01Assist = item->F_UpperKnife01Assist();
    m_F_UpperKnife02Assist = item->F_UpperKnife02Assist();
    m_B_UpperKnife01Assist = item->B_UpperKnife01Assist();
    m_B_UpperKnife02Assist = item->B_UpperKnife02Assist();
    m_F_UpperKnife01 = item->F_UpperKnife01();
    m_F_UpperKnife02 = item->F_UpperKnife02();
    m_B_UpperKnife01 = item->B_UpperKnife01();
    m_B_UpperKnife02 = item->B_UpperKnife02();
    m_F_LowerKnife01 = item->F_LowerKnife01();
    m_F_LowerKnife02 = item->F_LowerKnife02();
    m_B_LowerKnife01 = item->B_LowerKnife01();
    m_B_LowerKnife02 = item->B_LowerKnife02();
    m_Roller = item->Roller();
}

void ParameterItem::setId(int newId)
{
    if (m_id == newId) return;
    m_id = newId;
    emit idChanged();
}

void ParameterItem::setName(const QString &newName)
{
    if (m_Name == newName) return;
    m_Name = newName;
    emit NameChanged();
}

void ParameterItem::setProcess1(const QString &newProcess1)
{
    if (m_Process1 == newProcess1) return;
    m_Process1 = newProcess1;
    emit Process1Changed();
}

void ParameterItem::setProcess2(const QString &newProcess2)
{
    if (m_Process2 == newProcess2) return;
    m_Process2 = newProcess2;
    emit Process2Changed();
}

void ParameterItem::setF_UpperKnife01Assist(const QString &newVal)
{
    if (m_F_UpperKnife01Assist == newVal) return;
    m_F_UpperKnife01Assist = newVal;
    emit F_UpperKnife01AssistChanged();
}

void ParameterItem::setF_UpperKnife02Assist(const QString &newVal)
{
    if (m_F_UpperKnife02Assist == newVal) return;
    m_F_UpperKnife02Assist = newVal;
    emit F_UpperKnife02AssistChanged();
}

void ParameterItem::setB_UpperKnife01Assist(const QString &newVal)
{
    if (m_B_UpperKnife01Assist == newVal) return;
    m_B_UpperKnife01Assist = newVal;
    emit B_UpperKnife01AssistChanged();
}

void ParameterItem::setB_UpperKnife02Assist(const QString &newVal)
{
    if (m_B_UpperKnife02Assist == newVal) return;
    m_B_UpperKnife02Assist = newVal;
    emit B_UpperKnife02AssistChanged();
}

void ParameterItem::setF_UpperKnife01(const QString &newVal)
{
    if (m_F_UpperKnife01 == newVal) return;
    m_F_UpperKnife01 = newVal;
    emit F_UpperKnife01Changed();
}

void ParameterItem::setF_UpperKnife02(const QString &newVal)
{
    if (m_F_UpperKnife02 == newVal) return;
    m_F_UpperKnife02 = newVal;
    emit F_UpperKnife02Changed();
}

void ParameterItem::setB_UpperKnife01(const QString &newVal)
{
    if (m_B_UpperKnife01 == newVal) return;
    m_B_UpperKnife01 = newVal;
    emit B_UpperKnife01Changed();
}

void ParameterItem::setB_UpperKnife02(const QString &newVal)
{
    if (m_B_UpperKnife02 == newVal) return;
    m_B_UpperKnife02 = newVal;
    emit B_UpperKnife02Changed();
}

void ParameterItem::setF_LowerKnife01(const QString &newVal)
{
    if (m_F_LowerKnife01 == newVal) return;
    m_F_LowerKnife01 = newVal;
    emit F_LowerKnife01Changed();
}

void ParameterItem::setF_LowerKnife02(const QString &newVal)
{
    if (m_F_LowerKnife02 == newVal) return;
    m_F_LowerKnife02 = newVal;
    emit F_LowerKnife02Changed();
}

void ParameterItem::setB_LowerKnife01(const QString &newVal)
{
    if (m_B_LowerKnife01 == newVal) return;
    m_B_LowerKnife01 = newVal;
    emit B_LowerKnife01Changed();
}

void ParameterItem::setB_LowerKnife02(const QString &newVal)
{
    if (m_B_LowerKnife02 == newVal) return;
    m_B_LowerKnife02 = newVal;
    emit B_LowerKnife02Changed();
}

void ParameterItem::setRoller(const QString &newRoller)
{
    if (m_Roller == newRoller) return;
    m_Roller = newRoller;
    emit RollerChanged();
}
